<template>
</template>

<script>
	import {
		request
	} from '@/api/request';

	export default {
		data() {
			return {

			}
		},
		onLoad() {
			// 用户基本信息
			request({
				url: '/api/user/profile',
				method: 'GET',
				data: {},
				header: {
					'xx-token': uni.getStorageSync('token')
				}
			}).then((response) => {
				let identity = response.data.identity;
				if (identity == 1) {
					uni.reLaunch({
						url: '/pages/index/index'
					})
				} else if (identity == 2) {
					let role = response.data.role;
					if(role == 3){
						uni.reLaunch({
							url: '/pagesPartner/index/index'
						})
					}else{
						uni.reLaunch({
							url: '/pagesSale/index/index'
						})
					}
				} else if (identity == 3) {
					uni.reLaunch({
						url: '/pagesClient/index/index'
					})
				}
			}).catch((error) => {});
		}
	}
</script>

<style>
</style>